
const express = require("express");
const swagger = require("./swagger");
const router = require("./router");
const config = require("./config");
const network = require("os").networkInterfaces();
const app = express();
swagger(app, config);
app.listen(config.server.port, "0.0.0.0", () => {
  console.log("server:");
  JSON.stringify(network, (a, b) => {
    if (b.family && b.family === "IPv4") {
      console.log('\x1B[36m%s\x1B[0m', "       http://" + b.address + ":" + config.server.port);
    }
    return b;
  });
});
app.use(express.json());
app.use(express.urlencoded({ extended: false }));
app.use("/favicon.ico", () => true);
app.use(express.static("assets")); 
